import request from '@/utils/request'

// 查询问卷题目列表
export function listTitle(query) {
  return request({
    url: '/questionnaire/title/list',
    method: 'get',
    params: query
  })
}

// 查询问卷题目详细
export function getTitle(topicId) {
  return request({
    url: '/questionnaire/title/' + topicId,
    method: 'get'
  })
}

// 新增问卷题目
export function addTitle(data) {
  return request({
    url: '/questionnaire/title',
    method: 'post',
    data: data
  })
}

// 修改问卷题目
export function updateTitle(data) {
  return request({
    url: '/questionnaire/title',
    method: 'put',
    data: data
  })
}

// 删除问卷题目
export function delTitle(topicId) {
  return request({
    url: '/questionnaire/title/delete/' + topicId,
    method: 'delete'
  })
}

export function saveByQuestionnaireId(ids,questionnaireId) {
  return request({
    url: '/questionnaire/title/saveByQuestionnaireId/' + ids+"/"+questionnaireId,
    method: 'post'
  })
}

//查看问卷
export function getTitleByAnswer(questionnaireId) {
  return request({
    url: '/questionnaire/title/selectQuestionnaireTitle/' + questionnaireId,
    method: 'get'
  })
}
//发送方查看问卷详情题目和作答情况
export function selectQuestionnaireTitleBySend(questionnaireId,orgId){
  return request({
    url: '/questionnaire/title/selectQuestionnaireTitleBySend/'+questionnaireId+"/"+orgId,
    method: 'get'
  })
}
